function getRequest() {
    let url = location.search; //获取url中"?"符后的字串
    let theRequest = new Object();
    if(url.indexOf("?") != -1) {
        let str = url.substr(1);
        let strs = str.split("&");
        for(let i = 0; i < strs.length; i++) {
            theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);//uri编码
        }
    }
    return theRequest;
}

function load_data() {
    let username = localStorage.getItem("username");
    let role = localStorage.getItem("role");
    if((username == null || username == "") || role === "admin"){
        $(".tologin").show();
        $(".has-login").hide();
        $(".username").html('');
    }else{
        $(".tologin").hide();
        $(".has-login").show();
        $(".username").html(username);
    }
}